﻿//https://www.nowcoder.com/practice/0cfa856bf0d649b88f6260d878f35bb4?tpId=290&tqId=39937&ru=/exam/oj

#include <ios>
#include <iostream>
#include <vector>
using namespace std;

string SWord(string& str) {
    int j = 0;

    for (int i = 0; i < str.size(); i++) {
        if (str[0] >= 91) {
            str[0] = str[0] - 32;
        }
        if (str[i] == ' ') {
            j++;
            if (str[i + 1] >= 65 && str[i + 1] <= 90) {
                str[j] = str[i + 1];
            }
            else {
                str[j] = str[i + 1] - 32;
            }
        }
    }
    str.resize(j + 1);
    return str;
}


int main() {
    string a;
    getline(cin, a);
    cout << SWord(a) << endl;

}



#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    while (cin >> s) // ⾃动跳过空格
    {
        if (s[0] <= 'z' && s[0] >= 'a') cout << (char)(s[0] - 32);
        else cout << s[0];
    }
    return 0;
}


//https://ac.nowcoder.com/acm/problem/221681
#include <climits>
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n, x;
    cin >> n >> x;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int l = 0;
    int r = 0;
    int sum = 0;
    int minlen = INT_MAX;
    int minl = -1;
    while (r < n) {
        while (r < n && sum < x) {
            sum += a[r];
            r++;
        }

        if (sum >= x) {
            while (l < r && sum - a[l] >= x) {
                sum -= a[l];
                l++;
            }
            if (r - l < minlen) {
                minlen = r - l;
                minl = l;
            }
        }
        if (l < r) {
            sum -= a[l];
            l++;
        }

    }
    cout << minl + 1 << " " << minl + minlen;

    return 0;
}


#include <iostream>
using namespace std;

const int N = 1e7 + 10;
int arr[N];
int n, x;
int main()
{
    cin >> n >> x;
    for (int i = 1; i <= n; i++) cin >> arr[i];
    int left = 0, right = 0, sum = 0;
    int retLen = N, retLeft = -1, retRight = -1;
    while (right <= n)
    {
        sum += arr[right];
        while (sum >= x)
        {
            if (right - left + 1 < retLen)
            {
                retLeft = left;
                retRight = right;
                retLen = right - left + 1;
            }
            sum -= arr[left++];
        }
        right++;
    }
    cout << retLeft << " " << retRight << endl;
    return 0;
}


//https://ac.nowcoder.com/acm/problem/213140

#include <iostream>
#include <queue>
using namespace std;
typedef long long LL;
LL n, k;
priority_queue<LL> heap;
int main()
{
    cin >> n >> k;
    LL sum = 0, x;
    while (n--)
    {
        cin >> x;
        sum += x;
        if (x % 2 == 0) heap.push(x);
    }
    while (heap.size() && k--)
    {
        LL t = heap.top() / 2;
        heap.pop();
        sum -= t;
        if (t % 2 == 0) heap.push(t);
    }
    cout << sum << endl;
    return 0;
}